package com.itheima.sh;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
public class ConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
        System.out.println("----消费端启动成功-----");
    }

    // 注册RestTemplate的对象到Spring的容器中
    @Bean
    @LoadBalanced //负载均衡算法
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
